import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
<<<<<<< HEAD
import { createPinia } from 'pinia'
import './assets/styles/main.scss'
import Vue3StarrySky from 'vue3-starry-sky';
import 'vue3-starry-sky/lib/style.css';
// import axios from 'axios'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'virtual:svg-icons-register'
import SvgIcon from '@/components/svgIcon/index.vue'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import './router/permit'

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

const app = createApp(App)
//全局注册
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.component('svg-icon', SvgIcon)

// app.config.globalProperties.$axios=axios
app.use(router)
app.use(pinia)
app.use(Vue3StarrySky)
app.mount('#app')
=======
import './style.css'
import './assets/style/main.scss'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
// Element Plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// SVG Icon 组件
import SvgIcon from '@/components/svgIcon/index.vue'
// Vue3 Starry Sky
import Vue3StarrySky from 'vue3-starry-sky'
import 'vue3-starry-sky/lib/style.css'
// 路由权限
import './router/permit'

const app = createApp(App)
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

app.use(pinia)

// 注册 Element Plus 图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 注册 SVG Icon 组件
app.component('svg-icon', SvgIcon)

// 使用 Vue3 Starry Sky
app.use(Vue3StarrySky)

// 全局错误处理（抑制ResizeObserver错误）
window.addEventListener('error', (event) => {
  if (event.message && event.message.includes('offsetHeight')) {
    event.preventDefault()
    return true
  }
  return false
}, true)

app.use(router)
app.use(ElementPlus)
app.mount('#app')
>>>>>>> resume
